home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / security / doc / cert_advisories / CA-89:01.passwd.hole < prev    next >
Encoding:
Text File  |  1989-01-09  |  5.0 KB  |  183 lines

  1.  
  2. CA-89:01
  3.                                  CERT Advisory
  4.                                  January 1989
  5.                                  Passwd hole
  6. -----------------------------------------------------------------------------
  7.  
  8. The CERT center received the following information from Keith Bostic
  9. from the Computer Systems Research Group at UC-Berkeley on Dec. 21, 1988.
  10. This patch has also been posted to comp.bugs.4bsd.ucb-fixes.
  11.  
  12. Please note that this patch will only work with BSD 4.3.  If you have
  13. 4.2 please let me know and I will forward the correct patch.
  14.  
  15. -----------------------------------------------------------------------------
  16.  
  17. Ed DeHart
  18. Computer Emergency Response Team (CERT)
  19. Software Engineering Institute
  20. Carnegie Mellon University
  21. Pittsburgh, PA 15213-3890
  22.  
  23. Internet: cert@cert.sei.cmu.edu
  24. Telephone: 412-268-7090 24-hour hotline: CERT personnel answer
  25.            7:30a.m.-6:00p.m. EST, on call for
  26.            emergencies other hours.
  27.  
  28. Past advisories and other information are available for anonymous ftp
  29. from cert.sei.cmu.edu (192.88.209.5).
  30.  
  31.  
  32.  
  33.  
  34. Subject: security problem in passwd
  35. Index: bin/passwd.c 4.3BSD
  36.  
  37. Description:
  38.     There's a security problem associated with the passwd(1)
  39.     program in all known Berkeley systems.  This problem is
  40.     also in most Berkeley derived systems, see your vendor
  41.     for more information.
  42.  
  43. Fix:
  44.     Apply the following patch to the file src/bin/passwd.c and
  45.     recompile/reinstall it.
  46.  
  47. *** passwd.c.orig    Wed Dec 21 08:57:41 1988
  48. --- passwd.c    Wed Dec 21 09:00:25 1988
  49. ***************
  50. *** 332,337 ****
  51. --- 332,339 ----
  52.       return (crypt(pwbuf, saltc));
  53.   }
  54.   
  55. + #define    STRSIZE    100
  56.   char *
  57.   getloginshell(pwd, u, arg)
  58.       struct passwd *pwd;
  59. ***************
  60. *** 338,344 ****
  61.       int u;
  62.       char *arg;
  63.   {
  64. !     static char newshell[BUFSIZ];
  65.       char *cp, *valid, *getusershell();
  66.   
  67.       if (pwd->pw_shell == 0 || *pwd->pw_shell == '\0')
  68. --- 340,346 ----
  69.       int u;
  70.       char *arg;
  71.   {
  72. !     static char newshell[STRSIZE];
  73.       char *cp, *valid, *getusershell();
  74.   
  75.       if (pwd->pw_shell == 0 || *pwd->pw_shell == '\0')
  76. ***************
  77. *** 415,423 ****
  78.   getfingerinfo(pwd)
  79.       struct passwd *pwd;
  80.   {
  81. !     char in_str[BUFSIZ];
  82.       struct default_values *defaults, *get_defaults();
  83. !     static char answer[4*BUFSIZ];
  84.   
  85.       answer[0] = '\0';
  86.       defaults = get_defaults(pwd->pw_gecos);
  87. --- 417,425 ----
  88.   getfingerinfo(pwd)
  89.       struct passwd *pwd;
  90.   {
  91. !     char in_str[STRSIZE];
  92.       struct default_values *defaults, *get_defaults();
  93. !     static char answer[4*STRSIZE];
  94.   
  95.       answer[0] = '\0';
  96.       defaults = get_defaults(pwd->pw_gecos);
  97. ***************
  98. *** 429,435 ****
  99.        */
  100.       do {
  101.           printf("\nName [%s]: ", defaults->name);
  102. !         (void) fgets(in_str, BUFSIZ, stdin);
  103.           if (special_case(in_str, defaults->name)) 
  104.               break;
  105.       } while (illegal_input(in_str));
  106. --- 431,437 ----
  107.        */
  108.       do {
  109.           printf("\nName [%s]: ", defaults->name);
  110. !         (void) fgets(in_str, STRSIZE, stdin);
  111.           if (special_case(in_str, defaults->name)) 
  112.               break;
  113.       } while (illegal_input(in_str));
  114. ***************
  115. *** 440,446 ****
  116.       do {
  117.           printf("Room number (Exs: 597E or 197C) [%s]: ",
  118.               defaults->office_num);
  119. !         (void) fgets(in_str, BUFSIZ, stdin);
  120.           if (special_case(in_str, defaults->office_num))
  121.               break;
  122.       } while (illegal_input(in_str) || illegal_building(in_str));
  123. --- 442,448 ----
  124.       do {
  125.           printf("Room number (Exs: 597E or 197C) [%s]: ",
  126.               defaults->office_num);
  127. !         (void) fgets(in_str, STRSIZE, stdin);
  128.           if (special_case(in_str, defaults->office_num))
  129.               break;
  130.       } while (illegal_input(in_str) || illegal_building(in_str));
  131. ***************
  132. *** 452,458 ****
  133.       do {
  134.           printf("Office Phone (Ex: 6426000) [%s]: ",
  135.               defaults->office_phone);
  136. !         (void) fgets(in_str, BUFSIZ, stdin);
  137.           if (special_case(in_str, defaults->office_phone))
  138.               break;
  139.           remove_hyphens(in_str);
  140. --- 454,460 ----
  141.       do {
  142.           printf("Office Phone (Ex: 6426000) [%s]: ",
  143.               defaults->office_phone);
  144. !         (void) fgets(in_str, STRSIZE, stdin);
  145.           if (special_case(in_str, defaults->office_phone))
  146.               break;
  147.           remove_hyphens(in_str);
  148. ***************
  149. *** 464,470 ****
  150.        */
  151.       do {
  152.           printf("Home Phone (Ex: 9875432) [%s]: ", defaults->home_phone);
  153. !         (void) fgets(in_str, BUFSIZ, stdin);
  154.           if (special_case(in_str, defaults->home_phone))
  155.               break;
  156.           remove_hyphens(in_str);
  157. --- 466,472 ----
  158.        */
  159.       do {
  160.           printf("Home Phone (Ex: 9875432) [%s]: ", defaults->home_phone);
  161. !         (void) fgets(in_str, STRSIZE, stdin);
  162.           if (special_case(in_str, defaults->home_phone))
  163.               break;
  164.           remove_hyphens(in_str);
  165. ***************
  166. *** 501,507 ****
  167.       if (input_str[length-1] != '\n') {
  168.           /* the newline and the '\0' eat up two characters */
  169.           printf("Maximum number of characters allowed is %d\n",
  170. !             BUFSIZ-2);
  171.           /* flush the rest of the input line */
  172.           while (getchar() != '\n')
  173.               /* void */;
  174. --- 503,509 ----
  175.       if (input_str[length-1] != '\n') {
  176.           /* the newline and the '\0' eat up two characters */
  177.           printf("Maximum number of characters allowed is %d\n",
  178. !             STRSIZE-2);
  179.           /* flush the rest of the input line */
  180.           while (getchar() != '\n')
  181.               /* void */;
  182.